<template>
  <div>
    <card
      :title="title"
      :headstyle="cardstyle"
      :class="initAnchorInfo"
      shadow="nerver"
    >
      <!-- <PublicTable
        ref="table1"
        :loading="false"
        :table-data="info"
        :columns="columns"
        :options="options"
      />
      <div class="zy_title">单号</div> -->
      <PublicTable
        ref="table1"
        :loading="false"
        :table-data="zyinfo"
        :columns="zycolumns"
        :options="options"
      />
    </card>
  </div>
</template>

<script>

const columns = [
  {
    label: "日期",
    prop: "WORKDATE",
    minwidth: "110",
  },
  {
    label: "单号",
    prop: "DONO",
    minwidth: "140",
  },
  {
    label: "原货主",
    prop: "SHIPPERCODE",
    optionsdic: "sys_wtr",
    minwidth: "250",
  },
  {
    label: "新货主",
    optionsdic: "sys_wtr",
    prop: "NEWSHIPPER",
    minwidth: "250",
  },
  {
    label: "委托量",
    prop: "TONS",
    minwidth: "140",
  }
];
const zycolumns = [
  {
    label: "提单日期",
    prop: "THDATE",
    minwidth: "110",
  },
  {
    label: "单号",
    prop: "TDNO",
    minwidth: "140",
  },
  {
    label: "委托人",
    prop: "CONSIGNOR",
    optionsdic: "sys_wtr",
    minwidth: "250",
  },
  {
    label: "提货类型",
    optionsdic: "sys_thfs",
    prop: "TRANSTYPE",
    minwidth: "110",
  },
  {
    label: "提单吨数",
    prop: "PLANTONS",
    minwidth: "140",
  },
  {
    label: "剩余吨",
    prop: "SYTONS",
    minwidth: "140",
  },
  {
    label: "是否完结",
    prop: "ISFINISH",
    optionsdic: "sys_sf",
    minwidth: "100",
  }
];
export default {
  name: "Thbl",
  props: {
    initAnchorInfo: {
      type: String,
      default: "xxxxxxxx",
    },
    cardstyle: {
      type: Object,
      default() {
        return {}
      },
    },
    shipseq: {
      type: String,
      default() {
        return ""
      },
    },
    title: {
      type: String,
      default() {
        return ""
      },
    },
  },
  data() {
    return {
      info: [],
      zyinfo: [],
      columns,
      zycolumns,
      options: {},
    }
  },
  computed: {
    infoform() {
      return this.info[0] || {}
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.queryinfo()
    },
    // 查询船舶基本信息
    queryinfo() {
      this.$api.summary.ship_tihuoList({ shipseq: this.shipseq }).then((val) => {
        // console.log(val);
        this.zyinfo = val
      })
    },
  }
}
</script>

<style lang="scss" scoped>
@import url('./index.css');
</style>
